package paidaxing.blog.post.demo;

import lombok.AllArgsConstructor;
import lombok.Data;

import java.util.Arrays;
import java.util.List;

/**
 * 业务数据处理演练类
 *
 * @author heefM
 * @date 2025-10-22
 */
public class serviceDataTest {
    public static void main(String[] args) {


        // 题目要求：
        // 1. 按职位分组
        // 2. 统计每个职位的平均工龄
        // 3. 找出工龄超过3年的员工
        // 4. 按年龄降序排列
        // 5. 计算所有员工的平均年龄


    }

















    // 数据准备
    List<User> users = Arrays.asList(
            new User(1L, "张三", 25, "技术部", 8000),
            new User(2L, "李四", 30, "销售部", 12000),
            new User(3L, "王五", 28, "技术部", 10000),
            new User(4L, "赵六", 35, "销售部", 15000),
            new User(5L, "孙七", 22, "技术部", 6000)
    );
    // User类
    @Data
    @AllArgsConstructor
    class User {
        private Long id;
        private String name;
        private Integer age;
        private String department;
        private Integer salary;
    }

    // Order类
    @Data
    @AllArgsConstructor
    class Order {
        private Long id;
        private String productName;
        private Integer quantity;
        private Double price;
        private String orderDate;
    }

    // Employee类
    @Data
    @AllArgsConstructor
    class Employee {
        private String name;
        private String position;
        private Integer workYears;
        private Integer age;
    }
}
